﻿#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir D:\starcraft\BWAPI 3.7.4\Chaoslauncher  ; Ensures a consistent starting directory.

^r::
FileDelete, D:\starcraft\BroodWar\bwapi-data\AI\AmorphiS.dll
FileDelete, D:\starcraft\BroodWar\bwapi-data\AI\AmorphiS2.dll
FileCopy, D:\starcraft\BWAPI 3.7.4\amorphis-bwapi-player\Release\AmorphiS.dll, D:\starcraft\BroodWar\bwapi-data\AI\
FileCopy, D:\starcraft\BWAPI 3.7.4\amorphis-bwapi-player\Release\AmorphiS.dll, D:\starcraft\BroodWar\bwapi-data\AI\AmorphiS2.dll

Run D:\starcraft\BWAPI 3.7.4\Chaoslauncher\Chaoslauncher-MultiInstance.exe
Sleep, 500
click 59, 360
Sleep, 1000
host_id := WinExist("A")
WinActivate, ahk_id %host_id%
WinMove, 0, 150
;send m
;sleep 500
;send e
;sleep 1500
;click 80, 209
;send o
;sleep 500
;send o
;sleep 500
;send g
;sleep 500
;send o

Run D:\starcraft\BWAPI 3.7.4\Chaoslauncher\Chaoslauncher-MultiInstance.exe
Sleep, 500
click 59, 360
Sleep, 3000
guest_id := WinExist("A")
WinActivate, ahk_id %guest_id%
WinMove, 640, 150
;send m
;sleep 500
;send e
;sleep 1500
;click 80, 209
;send o
;sleep 500
;send o
;sleep 2000
;send o

WinActivate, ahk_id %host_id%
WinActivate, ahk_id %guest_id%

return


^e::
WinActivate, ahk_id %host_id%
sleep 500
click 631, 22
sleep 500
send x
WinActivate, ahk_id %guest_id%
sleep 500
click 631, 22
sleep 500
send x
WinActivate, AmorphiS - Visual C++ 2008 Express Edition
return

